#include "Noflash.h"

Noflash g_pNoflash;

void Noflash::Init()
{
	Active = false;
	OffsetA = *(DWORD**) (FindPattern::Find((DWORD)GetModuleHandle(L"client.dll"), 0x89B000 - 0x100, (BYTE*) FlashFindPatternA, FlashFindPatternB) + FlashPatternOffset);
	OffsetB = *(DWORD*) (FindPattern::Find((DWORD)GetModuleHandle(L"client.dll"), 0x89B000 - 0x100, (BYTE*) FlashOffsetFindPatternA, FlashOffsetFindPatternB) + FlashOffsetPatternOffset);
}

void Noflash::Enable()
{
	Active = true;
}

void Noflash::Disable()
{
	Active = false;
}

void Noflash::Set( bool Active )
{
	this->Active = Active;
}

void Noflash::Compute()
{
	if (Active)
	{
		*(float*) (*OffsetA + OffsetB) = 0.0f;
	}
}
